
#ifndef TP_TYPEDEF_H
#define TP_TYPEDEF_H

#include <stdlib.h>

#ifdef __cplusplus
#define TP_DECL_BEGIN extern "C" {
#define TP_DECL_END }
#else
#define TP_DECL_BEGIN
#define TP_DECL_END
#endif

#define DECL_PRIV(thiz, priv) PrivInfo* priv = (NULL != thiz) ? (PrivInfo*)thiz->priv : NULL

typedef enum _TpRet
{
	TP_RET_OK,
	TP_RET_FAIL,	
	TP_RET_BADARGS
}TpRet;

typedef enum _TpWindowType
{
	TP_WINDOW_APP,
	TP_WINDOW_DIALOG
}TpWindowType;

typedef struct _TpRect
{
	int x;
	int y;
	int w;
	int h;
}TpRect;

typedef struct _TpColor
{
	unsigned char b;
	unsigned char g;
	unsigned char r;
	unsigned char a;
}TpColor;

/* 最多有多少个事件源 */
#define TP_MAX_SOURCE 64

/* 最多有多少个应用应用窗口 */
#define TP_MAX_WINDOWS 24

/* 耽搁应用窗口上最多可以有多少个控件 */
#define TP_MAX_WND_CONTROLS 64

#define TP_MAX_IMAGE_DECODER 16

#include "tp_os.h"

#endif /*TP_TYPEDEF_H*/
